import 'package:flustars/flustars.dart';
import '/constant/keys.dart';
import '/generated/json/base/json_convert_content.dart';

/// desc: 获取本地用户信息
getUserUtil<T>(){
  var map = SpUtil.getObject(SpKeys.userInfo);
  if(map == null)  return T;
  T loginData = JsonConvert.fromJsonAsT<T>(map)!;
  return loginData;
}

/// desc: 存储本地用户信息
Future<bool?> setUserUtil(Object value) async{
  if(value  == '') return false;
  return await SpUtil.putObject (SpKeys.userInfo,value);
}

/// desc: 删除本地用户信息
Future<bool?> delUserUtil() async{
  return await SpUtil.remove (SpKeys.userInfo,);
}